package cn.edu.ustc.xrovers.action;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import cn.edu.ustc.xrovers.model.Loan;
import cn.edu.ustc.xrovers.service.HandleCompanyInfoService;

import com.opensymphony.xwork2.ActionSupport;

public class LoanInfoAction extends ActionSupport{
	
	private Loan loan;
	private String guaWay;
	private HandleCompanyInfoService hci;
	
	/**
	 * 保存贷款基本信息
	 * 金额，担保方式，日期
	 */
	@Override
	public String execute() throws Exception {
		HttpSession session=ServletActionContext.getRequest().getSession();
		boolean flag=hci.saveLoanInfo(session,loan,guaWay);
		if(!flag)
			return INPUT;
		else
			return SUCCESS;
	}
	
	/*getset方法*/
	public Loan getLoan() {
		return loan;
	}
	public void setLoan(Loan loan) {
		this.loan = loan;
	}
	public String getGuaWay() {
		return guaWay;
	}
	public void setGuaWay(String guaWay) {
		this.guaWay = guaWay;
	}
	public void setHci(HandleCompanyInfoService hci) {
		this.hci = hci;
	}
	public HandleCompanyInfoService getHci() {
		return hci;
	}
}
